package sel.me.mysql.mybatis.page.dialect;

import org.apache.ibatis.mapping.MappedStatement;

import sel.me.mysql.mybatis.page.po.PageBounds;

public class MySQLDialect extends Dialect {

    public MySQLDialect(MappedStatement mappedStatement, Object parameterObject, PageBounds pageBounds) {
        super(mappedStatement, parameterObject, pageBounds);
    }

    protected String getLimitString(String sql, String offsetName, int offset, String limitName, int limit) {
        StringBuffer buffer = new StringBuffer(sql.length() + 20).append(sql);
        if (offset > 0) {
            buffer.append(" limit " + offset + ", " + limit);
        } else {
            buffer.append(" limit " + limit);
        }
        return buffer.toString();
    }

}
